﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
<!-- 富文本编辑器 -->
<link rel="stylesheet" type="text/css"
	href="${path }/resource/plugin/kindeditor/themes/default/default.css" />
<link rel="stylesheet" type="text/css"
	href="${path }/resource/plugin/kindeditor/plugins/code/prettify.css" />
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/kindeditor.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/kindeditor/plugins/code/prettify.js"></script>
	
<style>
.check{
	border: 3px solid rgba(0, 128, 0, 0.51);
    width: 30px;
    height: 30px;
    border-radius: 5px;
}
.createTask{
	display:none;
}
</style>
<title></title>
</head>
<div class="ibox-content">
	<form class="form-horizontal" id="dataform"
		onsubmit="javascripr:return false;">
		<input type="hidden" name="tokenUrl" value="${tokenUrl}">	 
		<input type="hidden" name="token" value="${token}">
		<input type="hidden" name="projId" value="${obj.projId}">
		<input type="hidden" name="title" value="${obj.title}">
	<%-- 	<input type="hidden" name="content" value="${obj.content}"> --%>
		<c:if test="${obj ne null }">
			<input type="hidden" name="id" value="${obj.id }">
		</c:if>
		<div class="form-group">
			<label class="col-sm-3 control-label">标题</label>
			<div class="col-sm-8">
			    <div class="form-control-static">${obj.title}</div>
			</div>
		</div>
      
      	
      	<div class="form-group">
			<label class="col-sm-3 control-label">创建人</label>
			<div class="col-sm-8">
		    	<div class="form-control-static">${obj.createClientName}</div>
			</div>
		</div>
      	
      	<div class="form-group">
			<label class="col-sm-3 control-label">提出时间</label>
			<div class="col-sm-8">
			     <div class="form-control-static"><fmt:formatDate value='${obj.createTime}' pattern='yyyy-MM-dd'/></div>
			</div>
		</div>
      	
      	<div class="form-group">
			<label class="col-sm-3 control-label">问题内容</label>
			<div class="col-sm-8">
			 <p class="form-contorl-static">
			     ${obj.content}
			 </p>
			</div>
		</div>
		<!-- <div class="form-group">
		<label class="col-sm-3 control-label">所属模块<span class="text-danger">*</span></label>
			<div class="col-sm-6">
					<select class="form-control " size="1" name="interfaceId"
						id="parentId" dataType="*">
						<option value="" selected="selected">请选择项目模块</option>
					</select>				
				<div class="Validform_checktip"></div>
			</div>
		</div>  -->
	 	<div class="form-group">
			<label class="col-sm-3 control-label">问题类型<span class="text-danger">*</span></label>
			<div class="col-sm-6">
			   <select class="form-control autoFull select2" name="needType" dataType="*1-20"
					data-url="${path}/admin/dataDictionary/showDataDictionary" 
					data-filed="name" 
					data-value="name"
					data-param="{type:'问题类型'}"
					data-def="${obj.needType}"
					>
					<option value="">--问题类型--</option>
				</select>
				<div class="Validform_checktip"></div>
			</div>
		</div> 
      	<div class="form-group">
			<label class="col-sm-3 control-label">处理结果<span class="text-danger">*</span></label>
			 <div class="col-sm-6">
			   <select class="form-control autoFull select2" name="handleResult" dataType="*1-20"
					data-url="${path}/admin/dataDictionary/showDataDictionary" 
					data-filed="name" 
					data-value="name"
					data-param="{type:'问题处理结果'}"
					data-def="${obj.handleResult}"
					>
					<option value="">--请选择处理结果--</option>
				</select>
				<div class="Validform_checktip"></div>
		</div>
		</div>
		
		
      	   	<div class="form-group">
			<label class="col-sm-3 control-label">需求</label>
			 <div class="col-sm-6">
			   <select class="form-control autoFull select2" id="needId" name="needId"
					data-url="${path}/admin/need/showList" 
					data-filed="title" 
					data-value="id"
					data-param="{projId:'${obj.projId}'}"
					data-def="${obj.needId}"
					>
					<option value="">--请选择需求--</option>
				</select>

				<div class="Validform_checktip"></div>
		</div>
		 <button class="btn btn-default btn-sm mr-5" onClick="openLook()"  title="查看">
		 <i class="fa fa-search"></i>
		 </button>
		</div>
      	
      	
      <%-- 	<div class="form-group">
			<label class="col-sm-3 control-label">消耗工时<span class="text-danger">*</span></label>
			<div class="col-sm-8">
				<input type="text" dataType="n" class="form-control" 
					value="${obj.changeTime }" name="changeTime">
				<div class="Validform_checktip"></div>
			</div>
		</div> 
		--%>
		<div class="form-group">
			<label class="col-sm-3 control-label">问题原因(问题判断)</label>
			<div class="col-sm-8">
				<textarea name="reason">
					${obj.reason}
				</textarea>
			</div>
			<div class="Validform_checktip"></div>
		</div>
		
      	<div class="form-group">
			<label class="col-sm-3 control-label">解决方案</label>
			<div class="col-sm-8">
				<textarea name="handleSolution" id="artcontent">
					${obj.handleSolution}
				</textarea>
			</div>
			<div class="Validform_checktip"></div>
		</div>
		
      	<div class="form-group">
			<label class="col-sm-3 control-label">备注</label>
			<div class="col-sm-8">
				<textarea name="remark" id="artcontent">
					${obj.remark}
				</textarea>
			</div>
			<div class="Validform_checktip"></div>
		</div>
      	
		<%-- <input type="hidden" name="fileUrl" id="fileUrl" value="url">
		<div class="form-group">
		<label class="col-sm-2 control-label">附件</label>
			<div class="col-sm-8">
				<input onclick="MTools.chooesFile('#fileText2')"
					class="input-text upload-url radius form-control" type="text" id="showFileName2" value="${obj.fileName }"
					readonly style="width: 30%;display: inline;"> 
					<a onclick="MTools.chooesFile('#fileText2')" class="btn btn-primary radius"> 
					<i   class="fa fa-cloud-upload"></i> 浏览文件 </a> 
					<input type="button" class='btn btn-primary radius'onclick="MTools.upFile('#submitBtn2')" value="上传"> 
			</div>
		</div> --%>
		<c:choose>
			<c:when test="${obj.taskStatus eq '已创建'}">
				<div class="form-group">
					<label class="col-sm-3 control-label" style="color: red">已创建任务</label>
					<div class="col-sm-8">
					</div>
					<div class="Validform_checktip"></div>
				</div>
			</c:when>
			<c:otherwise>
				<div class="form-group">
					<label class="col-sm-3 control-label">是否创建任务 </label>
					<div class="col-sm-8">
						<div class="check" ></div>
					</div>
					<div class="Validform_checktip"></div>
				</div>
			</c:otherwise>
		</c:choose>
		
		<div class="createTask">
			<div class="form-group">
				<label class="col-sm-3 control-label">任务等级</label>
				<div class="col-sm-8">
					<select name="level" class="form-control autoFull check1" id="level"
					data-url="${path}/admin/task/showALLTaskLevel"
					data-filed="name" data-value="name"
					dataType="*" nullmsg="任务等级不能为空" ignore="ignore">
					<option value="">--请选择任务等级--</option>
				</select>				
				</div>
				<div class="Validform_checktip"></div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">预计结束时间</label>
				<div class="col-sm-8">
					<input type="text" dataType="*" class="form-control datetimepicker check1"	name="endTime" nullmsg="预计结束时间不能为空" ignore="ignore">				
				</div>
				<div class="Validform_checktip"></div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">故事点数</label>
			    <div class="col-sm-8">
			    
			       <select class="form-control check1" name="experienceNum" 
			        dataType="n" errormsg="填写正整数" ignore="ignore">
			      
			        <option value="0">请选择故事点数</option>
			        <option value="10"  >10</option>
			        <option value="20"  >20</option>
			        <option value="50"  >50</option>
			        <option value="100" >100</option>
			        <option value="150" >150</option>
			        <option value="200" >200</option>
			        <option value="500" >500</option>
			      </select>
			    </div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">金币值</label>
			    <div class="col-sm-8">
			     <input class="form-control check1" name="goldNum" dataType="n" nullmsg="金币不能为空" ignore="ignore">
			    </div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">指派人</label>
					
				<div class="col-sm-8" id="assignPerson">
					
				</div>
				<div class="Validform_checktip"></div>			
			</div>
		</div>
       
		<div class="form-group " >
			<div class="col-sm-12 text-center">
				
				<a href="javascript:;" onclick="myForm.submit()" class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp; 
				<button onclick="MTools.closeForm()" class="btn btn-danger radius" type="button">取消</button>
			</div>
		</div>
	</form>
	<%-- <iframe src="" name="blankFrame" id="blankFrame"
				style="height: 100px; width: 100px; display: none;"> </iframe>
	<form class="form form-horizontal" method="post" style="display: none;"
		enctype="multipart/form-data" target="blankFrame" 
	action="${path }/resource/plugin/kindeditor/zking_upload_json.jsp?fileType=file&hiddenId=fileUrl">
		<input id="fileText2" type="file" multiple name="file-1" onchange="MTools.selectFile('#showFileName2','#fileText2','')"  /> 
		<input type="submit" id="submitBtn2"/>
	</form> --%>
	
</div>
	
<script type="text/javascript">

 var editor1,editor2,editor3;
 var myForm;
$(function() {
		var num=1;
		$(".check").click(function(){
			
			var html1
			
			if(num===1){
				html1='<img class="a-img" src="${path }/resource/images/gg.png" > '
				$(this).append(html1);
				num=2;
				$(".createTask").show(300);
				$(".check1").removeAttr("ignore");
			}
			
			else{				
				$(".a-img").remove();
				num=1;
				$(".createTask").hide(300);
				$(".check1").attr("ignore","ignore");
			}
		})
	    $(".select2").select2({'width':'100%'});
	    MTools.autoFullSelect();
	    //初始化时间格式
	    $('.datetimepicker').datetimepicker({
			format : "yyyy-mm-dd",
			startView : 2,
			maxView : 3,
			minView : 2,
			 autoclose:true
		});
	 
	    //富文本框
		MUI.createEdit("handleSolution", '100%', '300px', 'editor1');
		MUI.createEdit("reason", '100%', '200px', 'editor2');
		MUI.createEdit("remark", '100%', '200px', 'editor3');
		initFunctionList();
		//表格初始化
		myForm=MForm.initForm({
			invokeUrl:"${path}/admin/changes/addOrModify",
			beforeSubmit:function(){
				editor1.sync();
				editor2.sync();
				editor3.sync();
				
			},
			afterSubmit:function(){
				parent.myGrid.serchData();
			},
		});
		var projId=${obj.projId};
		//加载本项目的开发人员
		$.AjaxProxy({
		a : false,
		c : false,
		p :{projId:projId}
		}).invoke("${path}/admin/changes/queryUsers", function(loj) {
			var html="";
			for(var i = 0; i < loj.getRowCount(); i++){
				html=html+"<input type='radio' class='check1' name='strUserId'  dataType='*' value='"+loj.getString(i,"userId")+"' ignore='ignore'>"+loj.getString(i,"userName")+"&nbsp;&nbsp;&nbsp;&nbsp;"
			}	
			$("#assignPerson").empty().html(html);
		});
	});
	

	
/**
 * 初始化模块
 */
function initFunctionList() {
	$.AjaxProxy({
		a : false,
		c : false
	}).invoke("${path}/admin/interfaceCate/all?projId=${obj.projId}", function(loj) {
		$("#parentId").createSelectTree(loj.attr("result").rows, {
			append : true,
			value:"name",
			defaultValue:"${obj.interfaceId}"
		});
	});

}
//打开需求查看界面
function openLook() {
	layer.open({
		type : 2,
		title : "需求详情",
		area : [ MUI.SIZE_L, '400px' ],
		maxmin : true,
		content : [ '${path}/admin/need/lookForm?id=' + $("#needId").val()]
	});
}
</script>
</body>
</html>